package com.gientech.test;

import com.gientech.spring.model.Coffee;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan("com.gientech.spring.model")
public class SpringBeanForScan {
    @Test
    public void Test() {
        // 使用@Component+@ComponentScan
        ApplicationContext ac = new AnnotationConfigApplicationContext(Coffee.class);

        Coffee coffee = ac.getBean(Coffee.class);
        System.out.println("ComponentScan loader Coffee bean = " + coffee);
    }
}
